using BlazorAdmin.Models;
using BlazorAdmin.Models.Auth;
using BootstrapBlazor.Components;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BlazorAdmin.Interface
{
    public interface ISettings
    {
        /// <summary>
        /// 保存、更新
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns>错误消息</returns>
        Task<string> SaveSettings(Setting entity);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="query">查询参数集合</param>
        /// <returns>分页数据</returns>
        Task<QueryData<Setting>> GetSettingsList(AppQueryOption query);

        /// <summary>
        /// 获取实例
        /// </summary>
        /// <param name="id">主键id</param>
        /// <returns>实例对象</returns>
        Task<Setting> GetSettings(int id);

        Task<Setting> GetSettings(string code);

        /// <summary>
        /// 删除实例
        /// </summary>
        /// <param name="ids">主键id集合</param>
        /// <returns></returns>
        Task<bool> DeleteSettings(List<int> ids);

        Task<ApiAccount> GetApiAccount(string user);

        Task<string> GetSettingsVal(string code);
    }
}
